package gxt.visual.util;

/**
 * @author eugenp
 */
@Deprecated
public final class CommonChecks{
	
	private CommonChecks(){
		throw new AssertionError();
	}
	
	//
	public static final void checkNullArgs( final Object... objects ){
		if( objects == null ){
			throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
		}
		
		for( final Object object : objects ){
			if( object == null ){
				throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
			}
		}
	}
	public static final void checkNullArgs( final Object object ){
		if( object == null ){
			throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
		}
	}
	
	public static final void assertNullArgs( final Object... objects ){
		if( objects == null ){
			throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
		}
		
		for( final Object object : objects ){
			assert ( object != null ): ErrorMessages.NULL_ARG;
		}
	}
	public static final void assertNullArgs( final Object object ){
		assert ( object != null ): ErrorMessages.NULL_ARG;
	}
	
	public static final void checkPositive( final int value ){
		if( value < 0 ){
			throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
		}
	}
	public static final void checkPositive( final int... values ){
		if( values == null ){
			throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
		}
		for( final int value : values ){
			if( value < 0 ){
				throw new IllegalArgumentException( ErrorMessages.NULL_ARG );
			}
		}
		
	}
	
}
